package org.example.demos.thread;

import java.util.concurrent.*;

public class Test {
    public static void main(String[] args) {
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1,1,1, TimeUnit.SECONDS,new ArrayBlockingQueue<>(1));

        Callable<String> callable = Executors.callable(null,"s");
        FutureTask<String> f = new FutureTask<>(callable);
//        new FutureTask<>();
        threadPoolExecutor.submit(f);
        threadPoolExecutor.execute(f);
    }
}
